<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="../../../attr.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!doctype html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8">
<link rel="stylesheet" href="${ctx}/css/sapar.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/common.css" />
<link rel="stylesheet" type="text/css" href="${ctx}/css/kkpager_blue.css" />
<script type="text/javascript" src="${ctx}/js/jquery.js"></script>
<script type="text/javascript" src="${ctx}/js/sapar.js"></script>
<script type="text/javascript" src="${ctx}/js/WdatePicker.js"></script>
<script type="text/javascript" src="${ctx}/assets/layer/layer.js"></script>
<script type="text/javascript" src="${ctx}/js/kkpager.min.js"></script>
<style>
.buttons{
margin-left:30px;
}
#ddd{
float:left;
}
th{
text-align:center;
}
td{
text-align:center;
}

</style>
<title>科室包发放记录</title>
</head>

<body>
    <div id="saper-container">
        <div id="saper-hd"></div>
        <div id="saper-bd">
            <div class="subfiled clearfix">
                <h2>科室包发放记录</h2>
            </div>
            
            <div id="table_left" class="table">
                    <!--表格具体内容-->
                    <div class="table-box">
                    
                        <%-- <div>
	                        <div id="ddd">
	                        <label>选择科室：</label>
	                            <select class="search_text" id="keshi">
				                                <c:if test="${dep.departmentId != null }">
				                                <option value="${dep.departmentId}">${dep.departmentName}</option>
				                                <option value="" >请选择</option>
				                                </c:if>
	                                            <c:if test="${dep.departmentId == null }">
	                                            <option value="">请选择</option>
	                                            </c:if>
				                            	<c:forEach items="${alldeparts}" var="pro">
				                                	<c:if test="${pro.departmentId != dep.departmentId}">
				                                	    <option value="${pro.departmentId}">${pro.departmentName}</option>
				                                    </c:if>
				                                </c:forEach>
	                            </select>
                            </div>
                            <div class="buttons"  id="ddd">
	                            <a href="javascript:;" class="sapar-btn sapar-btn-recom" id="chaxun">查询</a>
	                        </div>
                        </div> --%>
	        <table id="t">
				<thead>
					<tr>
						<!-- <th>申请流水</th> -->
						<th>科室</th>
						<th>模板编号</th>
						<th>模板名</th>
						<th>发放数量</th>

					</tr>
				</thead>
				<tbody>
					<c:if test="${keshibaojilu != null}">
						<c:forEach items="${keshibaojilu}" var="keshibao">
							<tr>
							    <td>
							    <c:if test="${keshibao.keshi != null}">${keshibao.keshi}</c:if>
							    <c:if test="${keshibao.keshi == null}">厂家</c:if>
							    
							    </td>
								<td>${keshibao.baoid}</td>
								<td>${keshibao.name}</td>
								<td>${keshibao.num}</td>
							</tr>
						</c:forEach>
					</c:if>
				</tbody>
			</table>
			</div>
			<div id="saper-ft">
			    <div id="kkpager"></div>
		    </div>
        </div>
    </div>
</div>
</body>

<script type="text/javascript">
function getParameter(name) { 
	var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); 
	var r = window.location.search.substr(1).match(reg); 
	if (r!=null) return unescape(r[2]); return null;
	}

$(function(){
	var keshi=$("#keshi").val();
	
	var totalPage = ${total};
	var pageNo = getParameter('pageIndex');
	if(!pageNo){
		pageNo = 1;
	}
	//生成分页
	//有些参数是可选的，比如lang，若不传有默认值
	kkpager.generPageHtml({
		pno : pageNo,
		//总页码
		total : totalPage,
		//链接前部
		hrefFormer : '${ctx}/wupingfafang/fafangnum',
		//链接尾部
		hrefLatter : '.do',
		getLink : function(n){
			return this.hrefFormer + this.hrefLatter + "?pageIndex="+n+"&searchTxt="+$(".search_text").val()+"&keshi="+keshi;
		}
	});

	$("#chaxun").click(function(){
		keshi=$("#keshi").val();
        window.location.href="${ctx}/wupingfafang/fafangnum.do?keshi="+keshi;
	});
});
</script>
